﻿<%@ Page Language="C#" AutoEventWireup="true" MasterPageFile="~/CRM.Master" CodeBehind="GLeads.aspx.cs"
    Inherits="crm.aplicacao.CRMSystem.GLeads" %>

<%@ Register Assembly="Ext.Net.UX" Namespace="Ext.Net.UX" TagPrefix="ux" %>
<%@ Register Assembly="Ext.Net" Namespace="Ext.Net" TagPrefix="ext" %>
<asp:Content ID="Content1" ContentPlaceHolderID="head" runat="server">
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="ContentPlaceHolder1" runat="server">
    <ext:Store ID="strOrigemLeads" runat="server">
        <Reader>
            <ext:JsonReader IDProperty="idorigemleads">
                <Fields>
                    <ext:RecordField Name="idorigemleads" />
                    <ext:RecordField Name="nome" />
                </Fields>
            </ext:JsonReader>
        </Reader>
    </ext:Store>
    <ext:GridPanel ID="GridLeads" runat="server" Title="Gerência de Leads" AutoScroll="true"
         Height="600">
        <Store>
            <ext:Store ID="strLeads" runat="server">
                <Reader>
                    <ext:JsonReader IDProperty="idleads">
                        <Fields>
                            <ext:RecordField Name="idleads" />
                            <ext:RecordField Name="nome" />
                            <ext:RecordField Name="empresa" />
                            <ext:RecordField Name="telefone" />
                        </Fields>
                    </ext:JsonReader>
                </Reader>
            </ext:Store>
        </Store>
        <TopBar>
            <ext:Toolbar ID="ToolbarLeads" runat="server" AutoWidth="true">
                <Items>
                    <ext:Button ID="btNovoLeads" runat="server" Text="Novo" Icon="Add">
                        <Listeners>
                            <Click Handler="#{WindowsNovoLeads}.show()" />
                        </Listeners>
                    </ext:Button>
                    <ext:Button ID="btEditarLeads" runat="server" Text="Editar" Icon="PageWhiteEdit">
                        <Listeners>
                            <Click Handler="alert('Ainda não Está Editando')" />
                        </Listeners>
                    </ext:Button>
                    <ext:Button ID="btRemoverLeads" runat="server" Text="Remover" Icon="Delete">
                        <Listeners>
                            <Click Handler="alert ('Ainda não Está Removendo')" />
                        </Listeners>
                    </ext:Button>
                </Items>
            </ext:Toolbar>
        </TopBar>
        <ColumnModel ID="ColumnModel1" runat="server">
            <Columns>
                <ext:Column ColumnID="colNomeLeads" Header="Nome" Width="350" DataIndex="nome" />
                <ext:Column ColumnID="colEmpresaLeads" Header="Empresa" Width="350" DataIndex="empresa" />
                <ext:Column ColumnID="colTelefoneLeads" Header="Telefone" Width="250" DataIndex="telefone" />
            </Columns>
        </ColumnModel>
        <SelectionModel>
            <ext:RowSelectionModel ID="RowSelectionModel1" runat="server" />
        </SelectionModel>
        <BottomBar>
            <ext:PagingToolbar ID="PagingToolbar1" runat="server" PageSize="20" />
        </BottomBar>
        <LoadMask ShowMask="true" />
    </ext:GridPanel>
    <ext:Window ID="WindowsNovoLeads" runat="server" Icon="UserBrown" Title="Dados do Leads"
        Hidden="true" Modal="true" Width="430" AutoHeight="true" Resizable="false">
        <Items>
            <ext:FormPanel ID="FormNovoLeads" runat="server" Padding="5" Layout="Anchor" BodyStyle="background-color: transparent;"
                Header="false">
                <Items>
                    <ext:TextField ID="txtNomeLeads" runat="server" FieldLabel="Nome" AnchorHorizontal="93%"
                        AllowBlank="false" MsgTarget="Side" />
                    <ext:TextField ID="txtEmpresaLeads" runat="server" FieldLabel="Empresa" AnchorHorizontal="93%"
                        AllowBlank="false" MsgTarget="Side" />
                    <ext:TextField ID="txtEmailLeads" runat="server" FieldLabel="Email" AnchorHorizontal="93%"
                        AllowBlank="false" MsgTarget="Side" />
                    <ext:TextField ID="txtTelefoneLeads" runat="server" FieldLabel="Telefone" AnchorHorizontal="93%"
                        AllowBlank="false" MsgTarget="Side">
                        <Plugins>
                            <ux:InputTextMask ID="InputTextMask1" runat="server" Mask="(99)9999-9999" />
                        </Plugins>
                    </ext:TextField>
                    <ext:ComboBox ID="cboOrigemLeads" runat="server" FieldLabel="Origem" AnchorHorizontal="93%"
                        AllowBlank="false" MsgTarget="Side" StoreID="strOrigemLeads" ValueField="idorigemleads"
                        DisplayField="nome" />
                    <ext:TextArea ID="txtObservacaoLeads" runat="server" FieldLabel="Observação" AnchorHorizontal="93%"
                        AllowBlank="true" MsgTarget="Side" />
                </Items>
                <Buttons>
                    <ext:Button ID="btGravarLeads" runat="server" Text="Gravar" Icon="Disk">
                        <Listeners>
                            <Click  Handler="Ext.net.DirectMethods.inserir();" />
                        </Listeners>
                    </ext:Button>
                    <ext:Button ID="btCancelar" runat="server" Text="Cancelar" Icon="Cancel">
                        <Listeners>
                            <Click Handler="#{WindowsNovoLeads}.hide();" />
                        </Listeners>
                    </ext:Button>
                </Buttons>
            </ext:FormPanel>
        </Items>
        <Listeners>
            <Close Handler="Ext.net.DirectMethods.limparCampo();" />
            <Hide Handler="Ext.net.DirectMethods.limparCampo();" />
        </Listeners>
    </ext:Window>
</asp:Content>
